package com.neusoft.neuiotms.dcom.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;

import org.hibernate.validator.constraints.Length;

import com.neusoft.bizcore.web.jpa.model.AbstractModel;
import com.neusoft.bizcore.web.jpa.model.Comment;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@Entity
@Table(name = "neuiot_inspection_rule_project_item")
@org.hibernate.annotations.Table(appliesTo = "neuiot_inspection_rule_project_item", comment = "巡检项表")
public class InspectionRuleProjectItem extends AbstractModel {

    private static final long serialVersionUID = -6267263922222222771L;

    @ManyToOne
    private InspectionRuleProject inspectionRuleProject;

    @NotBlank(message = "名称")
    @Length(max = 255, message = "名称不能超过{max}位")
    @Column(length = 255, nullable = false)
    @Comment("varchar(255) NOT NULL COMMENT '名称'")
    private String name;

    @NotBlank(message = "值类型")
    @Length(max = 255, message = "值类型不能超过{max}位")
    @Column(length = 255, nullable = false)
    @Comment("varchar(255) NOT NULL COMMENT '值类型'")
    private String valueType;

    @Length(max = 255, message = "单位不能超过{max}位")
    @Column(length = 255, nullable = true)
    @Comment("varchar(255)  NULL COMMENT '单位'")
    private String unit;

    @Column(length = 63, nullable = true)
    @Comment("double(63,3)  NULL COMMENT '预警值下限'")
    private Double earlyWarningDown;

    @Column(length = 63, nullable = true)
    @Comment("double(63,3) NULL COMMENT '预警值上限'")
    private Double earlyWarningUpper;

    @Column(length = 63, nullable = true)
    @Comment("double(63,3) NULL COMMENT '告警值下限'")
    private Double alarmDown;

    @Column(length = 63, nullable = true)
    @Comment("double(63,3) NULL COMMENT '告警值上限'")
    private Double alarmUpper;

    @Length(max = 1023, message = "预警值范围不能超过{max}位")
    @Column(length = 1023, nullable = true)
    @Comment("varchar(1023) NULL COMMENT '预警值范围'")
    private String earlyWarning;

    @Length(max = 1023, message = "告警值范围不能超过{max}位")
    @Column(length = 1023, nullable = true)
    @Comment("varchar(1023) NULL COMMENT '告警值范围'")
    private String alarm;

    @Column(length = 8, nullable = true)
    @Comment("int(8)  NULL COMMENT '排序'")
    private Integer sort;

    @Length(max = 255, message = "类别不能超过{max}位")
    @Column(length = 255, nullable = false)
    @Comment("varchar(255)  NULL COMMENT '类别'")
    private String type;
}
